package main

import (
	"fmt"
	"regexp"
)

const text = `
My email is test@126.com 
email1 is _34t@qq.com
email2 is fdslj@go.org
email3 is dsf@abc.com.cn
`

func main() {
	re := regexp.MustCompile(`([a-zA-Z_0-9]+)@(\w+)(\.[\w.]+)`)

	oneMatch := re.FindString(text)
	fmt.Println(oneMatch)

	manyMatch := re.FindAllString(text, -1)
	fmt.Println(manyMatch)

	subMatch := re.FindAllStringSubmatch(text, -1)
	fmt.Println(subMatch)
}
